﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LCLogin.aspx.cs" Inherits="RN.ERP.Web.LCLogin" %>

<%@ Register Src="UserControl/UCUserRight.ascx" TagName="UCUserRight" TagPrefix="ucUserRight" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link id="myStyleSheet" runat="server" rel="stylesheet" type="text/css" />
    <title>
        <%=PageTitle %></title>
    <link rel="Stylesheet" type="text/css" href="Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script type="text/javascript" src="Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="Scripts/ligerUI/js/ligerui.min.js"></script>
    <script src="Scripts/pta.js" type="text/javascript"></script>
    <script src="Scripts/calogin.js" type="text/javascript"></script>
    <script type="text/javascript">

//          window.location.reload( ); 

        function keyLogin(e) {
            var e = e || event;
            if (e.keyCode == 13) {
                if ($("#TabTab03Con1").css("display") == "block") {
                    $("#zhuguanLogin").click();
                }
                else {
                    $("#shichangLogin").click();
                }
            }
        }
        function setTab03Syn(data) {
            if (data == 1) {
                $("#TabTab03Con1").css("display", "block");
               
                $("#font2").css("color", "#333333");
            }
           
        }

        function _dialog(type, msg) {
//            var h = $(".main").height();
            $.ligerDialog[type](msg);
//            $(".main").height(h);
        }
        function getKeyInfo(key) {
            $.ajax({
                type: 'post',
                cache: false,
                dataType: 'text',
                url: 'Handlers/LoginHandler.ashx',
                data: { dogId: key, action: "GetUserInfobyDogID" },
                success: function (str) {
                   
                    var data = eval("(" + str + ")");
                    $('#inp_name').val(data.Message);
                    var type = data.Result;
                    if (data.Result) {
                        $("input[name='type'][value= '1']").attr("checked", true);
                    }
                    else {
                        $("input[name='type'][value= '0']").attr("checked", true);
                        if (data.ReturnValue != "null" && data.ReturnValue != null)
                            $("#TabTab03Con1 ul li:first").before("  <li style='text-align:left;padding:0px;margin:0px;padding-left:47px;height:24px; line-height:24px;'>企业名称：" + data.ReturnValue + "</li>");
                    }
                },
                error: function () {
                    _dialog("error", '登录失败，请与客服联系！');
                },
                beforeSend: function () {
                    _dialog("waitting", "正在获取key信息,请稍后...");
                    //                            $("#btnLogin").attr("disabled", true);
                },
                complete: function () {
                    $.ligerDialog.closeWaitting();
                    $("#btnLogin").attr("disabled", false);
                }
            });

        };
        $(function () {

            $('.Register').attr("href", 'Register.aspx');
            $('.Register').hide();

            document.onkeydown = keyLogin;
           
            var Result = CheckDogCA();

            var str = Result.split(',');
            if ($("select option").length == 0) {
                $("select").css("display", "none");
            }
            else {
                $("select").css("display", "block");
            }
            if (str[0] == "0") {
                getKeyInfo(str[1]);
            }

            $("#zhuguanLogin").click(function () {
              
                var username = $('#inp_name').val();
                var password = $('#inp_email').val();
                var usertype = $("input[name='type'][checked=checked]").attr("value") == "1" ? "Manager" : "User";
                if (username == "" || password == "") {
                    _dialog("error", '用户名或密码不能为空');
                    //radalert('用户名或密码不能为空', 300, 150, '提示');
                }
                else {
                    if (str[0] == "0") {
                        $.ajax({
                            type: 'post',
                            cache: false,
                            dataType: 'text',
                            url: 'Handlers/LoginHandler.ashx',
                            data: { username: username, password: password, dogId: str[1], type: usertype },
                            success: function (result) {
                                if (result == "success") {
                                    var width = $(window).width();
                                    var height = $(window).height();
                                    parent.document.location.href = "Mainframe.aspx";
                                }
                                else {
                                    _dialog("error", result);
                                    //radalert(msg, 300, 150, '提示');
                                }
                            },
                            error: function () {
                                _dialog("error", '登录失败，请与客服联系！');
                            },
                            beforeSend: function () {
                                _dialog("waitting", "正在登录中,请稍后...");
                                $("#btnLogin").attr("disabled", true);
                            },
                            complete: function () {
                                $.ligerDialog.closeWaitting();
                                $("#btnLogin").attr("disabled", false);
                            }
                        });

                    }
                    else {
                        _dialog("error", unescape(str[1]));
                        //radalert(unescape(str[1]), 300, 150, '提示');
                    }
                }

            });

            $(".a_qq").click(function () {
                $("#divQQ").css("display", "block");
            })
        });
    </script>
    <style type="text/css">
        .tab
        {
            border-collapse: collapse;
        }
        .tab a
        {
            text-decoration: none;
            color: #1269a1;
        }
        .tab a:hover
        {
            text-decoration: underline;
        }
        
        .bg_tt{top:30%; left:30%; background:url(Images/xtbg.png) no-repeat; width:531px; height:446px;postion:abouslt;}
		.bg_tt p{ padding:60px;font-size:16px; font-weight:bold; line-height:32px;text-align:left;}

    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="header">
            <div class="logo">
            </div>
        </div>
        <div class="main">
            <div class="banner">
            
                        <div class="bg_tt" style="display: none">
     
        </div>

                <div class="con">
                    <div id="bg" class="xixi1">
                        <div id="font1" class="tab1" onclick="setTab03Syn(1);document.getElementById('bg').className='xixi1'">
                            用户登陆
                        </div>
                       
                    </div>
                    <div id="TabTab03Con1">
                        <ul class="input_test">
                         <li style="text-align:left;padding:ppx; margin:0px;padding-left:47px;margin-bottom:14px; height:24px; line-height:24px;" >
                             用户类型：   <input  class="" type="radio" name="type" value="0"  />企业用户 <input  class="" type="radio" value="1" checked="checked" name="type" />主管用户
                            </li>
                            <li>
                                <input id="inp_name" class="input_out" type="text" onfocus="this.className='input_on';this.onmouseout=''"
                                    onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};"
                                    onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"
                                    style="background: url(images/yh.gif) 5px center no-repeat; padding-left: 26px;
                                    width: 212px; font-family: Verdana, Geneva, sans-serif; font-size: 14px;" />
                            </li>
                            <li>
                                <input id="inp_email" class="input_out" name="" type="password" onfocus="this.className='input_on';this.onmouseout=''"
                                    onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};"
                                    onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"
                                    style="background: url(images/mm.gif) 5px center no-repeat; padding-left: 26px;
                                    width: 212px; font-family: Verdana, Geneva, sans-serif; font-size: 14px;" />
                            </li>
                        </ul>
                        <div class="key">
                            <%--<p>
                                未检测到登陆证书Key</p>--%>
                            <asp:DropDownList ID="CertList1" runat="server">
                            </asp:DropDownList>
                          
                        </div>
                        <div class="btn">
                            <a id="zhuguanLogin" style="cursor: pointer;">登 录</a></div>
                        <div class="btm">
                            <ul>
<%--                                <li><a href="#" class="Register Manager">
                                    <img src="images/zc.jpg" width="54" height="44" alt="" /></a><p class="wenzi">
                                        <a href="#" class="Register Manager" id="RegManager">注册用户</a></p>
                                </li>--%>
                                <li><a href="#">
                                    <img src="images/wjmm.jpg" width="54" height="44" alt="" /></a><p class="wenzi">
                                        <a href="#">忘记密码</a></p>
                                </li>
                                <li><a class="a_qq" style="cursor: pointer;">
                                    <img src="images/qq.jpg" width="54" height="44" alt="" /></a><p class="wenzi">
                                        <a class="a_qq" style="cursor: pointer;">QQ客服</a></p>
                                </li>
                                <li><a href="#">
                                    <img src="images/bz.jpg" width="54" height="44" alt="" /></a><p class="wenzi">
                                        <a href="#">帮助</a></p>
                                </li>
                            </ul>
                            <div class="clear">
                            </div>
                        </div>
                    </div>                  
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
        <ucUserRight:UCUserRight ID="UCUserRight1" runat="server" />
    </div>
    <div id="divQQ" style="z-index: 999; right: 40px; visibility: visible; width: 76px;
        position: absolute; top: 200px; height: 203px; display: none;">
        <table width="100" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="3" style="font-size: 0px;">
                    <img src="Images/QQ_3.gif" width="106" height="71" border="0" usemap="#Map">
                </td>
            </tr>
            <tr>
                <td width="4" height="78" background="images/QQ_8.gif">
                </td>
                <td width="98" align="center" bgcolor="#FFFFFF">
                    <table width="100%" cellspacing="0" cellpadding="3" class="tab">
                        <tr>
                            <td width="36%" height="22">
                                <div align="center">
                                    <img src="http://wpa.qq.com/pa?p=1:1215554807:4" border='0' width="22" height="17"></div>
                            </td>
                            <td width="64%" height="22">
                                <a href="http://wpa.qq.com/msgrd?V=1&amp;Uin=1215554807&amp;Site=QQ咨询&amp;Menu=yes"
                                    target='_blank'>QQ客服1</a>
                            </td>
                        </tr>
                        <tr>
                            <td height="22">
                                <div align="center">
                                    <img src="http://wpa.qq.com/pa?p=1:2385016278:4" border='0' width="22" height="17"></div>
                            </td>
                            <td height="22">
                                <a href="http://wpa.qq.com/msgrd?V=1&amp;Uin=2385016278&amp;Site=QQ咨询&amp;Menu=yes"
                                    target='_blank'>QQ客服2</a>
                            </td>
                        </tr>
                        <tr>
                            <td height="22">
                                <div align="center">
                                    <img src="http://wpa.qq.com/pa?p=1:1731434335:4" border='0' width="22" height="17"></div>
                            </td>
                            <td height="22">
                                <a href="http://wpa.qq.com/msgrd?V=1&amp;Uin=1731434335&amp;Site=QQ咨询&amp;Menu=yes"
                                    target='_blank'>QQ客服3</a>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="4" background="Images/QQ_7.gif">
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <img src="Images/QQ_12.gif" width="106" height="44">
                </td>
            </tr>
        </table>
    </div>
    <map name="Map" id="Map">
        <area shape="poly" coords="78,3,82,17,90,18,97,13,98,8,98,3,77,3" href="javascript:"
            onclick="divQQ.style.display='none';" title="关闭" />
    </map>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
        Skin="WebBlue">
    </telerik:RadWindowManager>
    </form>
    <object id="keyinfo" codebase="Content/gksn.cab" classid="clsid:12D390AD-D96D-4826-AA23-DC4D9456AB4D">
    </object>
    <object id="iTrusPTA" codebase="Content/itruscertctl.cab#version=2,5,6,0" classid="clsid:F1F0506B-E2DC-4910-9CFC-4D7B18FEA5F9">
    </object>
    <script language="javascript" type="text/javascript" src="http://js.users.51.la/17099392.js"></script>
    <center>
        <noscript>
            <a href="http://www.51.la/?17099392" target="_blank">
            <img alt="&#x6211;&#x8981;&#x5566;&#x514D;&#x8D39;&#x7EDF;&#x8BA1;" src="http://img.users.51.la/17099392.asp" style="border:none" />
            </a>
        </noscript>
    </center>
</body>
<script type="text/javascript">
    var appid = '<%=SystemID %>'; //97;
</script>
</html>
